<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Customers.aspx.cs" Inherits="Customers" Title="Customers" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>Work Organizer - Customers</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
    <table style="width: 100%">
        <tr>
            <td align="center" style="width: 100%">
                <asp:Label ID="lblAppnts" runat="server" Text="Customers" Font-Bold="True" Font-Size="X-Large"
                    ForeColor="#3333FF"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <span style="font-family: Arial, Helvetica, sans-serif; font-size: large; font-weight: normal;
                    color: #008000; padding-left: 20px">Please upload Customers excel sheet here.</span>
                <br />
                <br />
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:FileUpload ID="FileUpload1" runat="server" /><br />
                <br />
                <asp:Button ID="btnFileToDB" runat="server" Text="Upload Customers" OnClick="UploadBtn_Click" />
            </td>
        </tr>
        <tr>
            <td align="right" style="padding-right:25px"><asp:LinkButton ID="LinkButton2" runat="server" PostBackUrl="~/AddCustomer.aspx">Add New Customer</asp:LinkButton>
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:DataGrid ID="Grid" runat="server" PageSize="5" DataKeyField="id" AutoGenerateColumns="False"
                    CellPadding="4" ForeColor="#333333" GridLines="None" OnCancelCommand="Grid_CancelCommand" 
                    OnDeleteCommand="Grid_DeleteCommand" OnEditCommand="Grid_EditCommand" OnUpdateCommand="Grid_UpdateCommand" 
                    Width="95%" AllowSorting="true" >
                    <Columns>
                        <asp:TemplateColumn HeaderText="S.No">
                            <ItemTemplate>
                                <span>
                                    <%# Container.ItemIndex+1 %></span>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:BoundColumn HeaderText="Id" DataField="id" ReadOnly="true" Visible="false"></asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Name" DataField="name" ></asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Address" DataField="address"></asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Email" DataField="email"></asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Contact Person" DataField="contact_person"></asp:BoundColumn>
                        <asp:BoundColumn HeaderText="Contact Number" DataField="contact_number"></asp:BoundColumn>
                        <asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update" HeaderText="Edit">
                        </asp:EditCommandColumn>
                        <asp:ButtonColumn CommandName="Delete" HeaderText="Delete" Text="Delete"></asp:ButtonColumn>
                    </Columns>
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <EditItemStyle BackColor="#999999" />
                    <SelectedItemStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <AlternatingItemStyle BackColor="White" ForeColor="#284775" />
                    <ItemStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                </asp:DataGrid>
            </td>
        </tr>
        <tr>
            <td>
                <br />
                <br />
                <br />
                <br />
                <br />
            </td>
        </tr>
    </table>
</asp:Content>
